<?php
include("database.php");
$con = mysqli_connect($hostname,$username,$password,$dbname);
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$sql="INSERT INTO DonateList (Name, Contact, Location, Donation)
VALUES
('$_POST[Name]','$_POST[Contact]','$_POST[Location]','$_POST[Donation]')";

if (!mysqli_query($con,$sql))
  {
  die('Error: ' . mysqli_error($con));
  }
echo "1 record added";

mysqli_close($con);
?>